﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Mail;
using System.Net;
using System.Configuration;
using System.Net.Configuration;

namespace Q.Tools.Email
{
    public sealed class EmailSender
    {
        

        public static void SendMail(string host, int port)
        {
            SmtpClient client = new SmtpClient();
            client.Credentials = new NetworkCredential("", "***");
            client.UseDefaultCredentials = true;
            //client.set
        }


        public static void Cfg()
        {
            Configuration cfg = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
            SmtpSection smtp = (SmtpSection)cfg.GetSection("system.net/mailSettings/smtp");
           smtp.Network.UserName = "xwy232";
           cfg.Save();

           SmtpClient client = new SmtpClient();
            
           //cfg.Save();
        }
        
    }
}
